//
//  BBRemindViewController.m
//  BearSiX
//
//  Created by Tom on 16/3/25.
//  Copyright © 2016年 Tom. All rights reserved.
//

#import "BBRemindViewController.h"

@interface BBRemindViewController ()<UITableViewDataSource,UITableViewDelegate>
{
    NSArray *_dataArr;
    NSArray *_dataArr2;
    NSArray *_dataArr3;
}
@property(nonatomic,strong)UITableView *tableView;
@end

@implementation BBRemindViewController
-(UITableView *)tableView{
    
    if (!_tableView) {
        _tableView =[[UITableView alloc]initWithFrame:CGRectMake(0, 0, WINSIZEWIDTH, WINSIZEHEIGHT)];
        _tableView.delegate = self;
        _tableView.dataSource = self;
        //_tableView.userInteractionEnabled=NO;
    }
    
    return _tableView;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    //UITableView *icontbv=[[UITableView alloc]initWithFrame:CGRectMake(0, 64, WINSIZEWIDTH, 100)];
    
    [self.view addSubview:self.tableView];
    
    _dataArr = @[@[@"头像"],
                 @[@"拍照",@"选片",@"看板",@"取件"],
                 @[@"任务",@"申请"]];
    _dataArr2 = @[@[@"需要电访预约订单客户"],
                  @[@"需要电访预约拍照客户",@"需要电访预约选片客户",@"需要电访预约看版客户",@"需要电访预约取件客户"],
                  @[@"需要我做的任务",@"需要我查看的申请流程"]];
    _dataArr3 = @[@[@"18-1"],
                 @[@"18-2",@"18-3",@"18-4",@"18-5"],
                 @[@"18-6",@"18-7"]];
    
    
    // Do any additional setup after loading the view.
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    
    return _dataArr.count;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return  ((NSArray *)_dataArr[section]).count;
}
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
    return WINSIZEWIDTH/30;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    UITableViewCell *cell = [[UITableViewCell alloc]initWithStyle:(UITableViewCellStyleSubtitle) reuseIdentifier:nil];
    cell.textLabel.text = _dataArr[indexPath.section][indexPath.row];
    cell.textLabel.font=[UIFont fontWithName:@"Helvetica" size:17.f];
    cell.detailTextLabel.text=_dataArr2[indexPath.section][indexPath.row];
    cell.detailTextLabel.textColor=[UIColor lightGrayColor];
    cell.detailTextLabel.font=[UIFont fontWithName:@"Helvetica" size:15.f];
    cell.accessoryType=UITableViewCellAccessoryDisclosureIndicator;
    cell.imageView.image= [UIImage imageNamed:_dataArr3[indexPath.section][indexPath.row]];
    UILabel *remindlabel=[[UILabel alloc]initWithFrame:CGRectMake(WINSIZEWIDTH-50, 30, 20, 20)];
    remindlabel.backgroundColor=[UIColor colorWithHexString:@"ff0022"];
    //ff0022
    remindlabel.text=@"2";
    if (remindlabel.text.length>1) {
        remindlabel.font=[UIFont fontWithName:@"Helvetica" size:13.f];
    }
    remindlabel.font=[UIFont fontWithName:@"Helvetica" size:16.f];
    remindlabel.textColor=[UIColor whiteColor];
    remindlabel.textAlignment= NSTextAlignmentCenter;
    [cell addSubview:remindlabel];
    remindlabel.layer.cornerRadius = 10;
    remindlabel.clipsToBounds = YES;
    return cell;
    
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
  
    return 80;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{

    [tableView deselectRowAtIndexPath:indexPath animated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
